﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;
using DevComponents.WinForms;
using RM2012Server.Controller;

namespace RM2012Server.View
{
    public partial class frmInvoiceDetail : Office2007Form
    {
        #region Fields
        InvoiceCtrl m_InvoiceCtrl = new InvoiceCtrl();
        InvoiceDetailCtrl m_InvoiceDetailCtrl = new InvoiceDetailCtrl();
        #endregion

        #region Constructor
        public frmInvoiceDetail()
        {
            InitializeComponent();
        }
        #endregion

        #region Load
        private void frmInvoiceDetail_Load(object sender, EventArgs e)
        {
            LoadData();
        }
        #endregion

        #region Public Method
        public void LoadData()
        {
            try
            {
                String invoiceId = this.Text.Substring(0, 14);
                DataTable dtSource = m_InvoiceDetailCtrl.GetReportByInvoiceId(invoiceId);
                dgvDetail.DataSource = dtSource;
                dgvDetail.Refresh();
            }
            catch
            {
            	
            }
        }
        #endregion
    }
}
